<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form prependId="false" id="form" enctype="multipart/form-data">
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['button.save']}" action="#{clienteImportarPlanilhaMB.insert}" ajax="false" disabled="#{clienteImportarPlanilhaMB.file == null}"/>
				</p:toolbarGroup>
			</p:toolbar>
			<br />
			<p:fieldset legend="#{messages['cliente.label']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid id="fields" columns="3">

					<h:outputLabel value="#{messages['cliente.label.separacao']}: " for="separacao" styleClass="text-input" />
					<h:inputText id="separacao" value="#{clienteImportarPlanilhaMB.separacao}" required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}" size="2" maxlength="1"
						title="#{messages['rd.alt.descricao']}"  >
						<p:ajax listener="#{cooperativadoImportarPlanilhaMB.setarSeparacao()}"  event="change"/>
					</h:inputText>
					<p:message for="separacao" />

					<h:outputLabel value="#{messages['cliente.label.selecione']}: " for="file" styleClass="text-input" />
					<p:fileUpload id="file" value="#{clienteImportarPlanilhaMB.file}" fileUploadListener="#{clienteImportarPlanilhaMB.handleFileUpload}" mode="advanced" 
						dragDropSupport="true"
                  		update="form" sizeLimit="10000000" fileLimit="3" allowTypes="/(\.|\/)(csv)$/" auto="false" >
                  	</p:fileUpload>
					<p:message for="file" />

					<h:outputLabel value="#{messages['cliente.label.planilha']}: " for="file" styleClass="text-input" />
					<h:outputLabel value="#{clienteImportarPlanilhaMB.file.file.fileName}" rendered="#{clienteImportarPlanilhaMB.file != null}" id="ok"/>

				</h:panelGrid>
			</p:fieldset>

		</h:form>
	</ui:define>
</ui:composition>